<extend name="./Template/Admin/Common/panel-block.html"/>
<block name="body">
    <form action="{:U()}" method="post" class="layui-form layui-box" ajaxSubmit>
        <icy8:formItem label="开启验证码" help="是否开启登录验证码">
            <input name="verify_open" lay-filter="verify_open" type="radio" value="1" title="开启"/>
            <input name="verify_open" lay-filter="verify_open" type="radio" value="0" title="关闭"/>
        </icy8:formItem>
        <div class="" id="verify_conf"
        <if condition="!$info['verify_open']">style="display: none"</if>
        >
        <icy8:formItem label="验证码有效期" help="验证码的有效期（秒）">
            <input name="verify[expire]" class="layui-input width-auto" type="number" value="{$info.verify.expire}"/>
        </icy8:formItem>
        <icy8:formItem label="验证码字体大小" help="图片验证码的字体大小, 单位px">
            <input name="verify[font_size]" class="layui-input width-auto" type="number" value="{$info.verify.font_size}"/>
        </icy8:formItem>
        <icy8:formItem label="验证码位数" help="图片验证码文字长度">
            <input name="verify[length]" class="layui-input width-auto" type="number" value="{$info.verify.length}"/>
        </icy8:formItem>
        <icy8:formItem label="验证码宽度" help="设置为0为自动计算">
            <input name="verify[imageW]" class="layui-input width-auto" type="number" value="{$info.verify.imageW}"/>
        </icy8:formItem>
        <icy8:formItem label="验证码高度" help="设置为0为自动计算">
            <input name="verify[imageH]" class="layui-input width-auto" type="number" value="{$info.verify.imageH}"/>
        </icy8:formItem>
        <icy8:formItem label="验证码密钥" help="验证码的加密密钥">
            <input name="verify[seKey]" class="layui-input width-auto" type="text" value="{$info.verify.seKey}"/>
        </icy8:formItem>
        </div>
        <icy8:formItem label="第三方登录" help="是否开启第三方登录">
            <input name="third_open" lay-filter="third_open" type="radio" value="1" title="开启"/>
            <input name="third_open" lay-filter="third_open" type="radio" value="0" title="关闭"/>
        </icy8:formItem>
        <div id="third_conf"
        <if condition="!$info['third_open']">style="display:none"</if>
        >
        <icy8:formItem label="第三方平台" help="开启第三方平台的登录接口，如果开启了第三方登录请配置此项">
            <input name="third[]" type="checkbox" value="QQ"
            <if condition="in_array('QQ',$info['third'])">checked</if>
            title="QQ登录"/>
            <input name="third[]" type="checkbox" value="Wechat"
            <if condition="in_array('Wechat',$info['third'])">checked</if>
            title="微信登录"/>
        </icy8:formItem>
        </div>
        <icy8:formItem label="">
            <icy8:button title="保存"/>
            <icy8:button title="取消" click="javascript:history.go(-1);" btnType="primary" type="button"/>
        </icy8:formItem>
    </form>
    <script type="text/javascript">
        layui.use('form', function () {
            layui.form.on('radio(verify_open)', function (data) {
                if (data.value == 1) {
                    $('#verify_conf').show();
                } else {
                    $('#verify_conf').hide();
                }
            });
            layui.form.on('radio(third_open)', function (data) {
                if (data.value == 1) {
                    $('#third_conf').show();
                } else {
                    $('#third_conf').hide();
                }
            });
        });
        Think.setValue('verify_open', '{$info.verify_open|default="0"}');
        Think.setValue('third_open', '{$info.third_open|default="0"}');
    </script>
</block>